home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / reverseclip.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-22  |  3KB  |  107 lines

  1. /* ReverseClip.rexx V2.0 -- This will Reverse a clip.   */
  2. /* By Bob Caron © 1995 NewTek Inc.                      */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. if InClipName="" & OutClipName="" then do
  11.  'Askb'"This only works;from process clip."
  12.  exit
  13.  end
  14.  
  15. if endfield>startfield then do
  16.  'Askb'"You must reverse;In and out points."
  17.  exit
  18.  end
  19.  
  20.  
  21. IFFBaseName=OutClipName
  22. if OutClipName="0" | OutClipName="" then do
  23.  'Askb'"Please select;A source clip."
  24.  exit
  25.  end
  26.  
  27. if ~show('l','rexxsupport.library') then do
  28.   if ~addlib('rexxsupport.library',0,-30,34) then do
  29.     exit
  30.   end
  31. end
  32.  
  33. PageWide=752
  34. PageHigh=480
  35. dots=0
  36. XWin = 100
  37. YWin = 40
  38. Clear = d2c(12)
  39. nv = ''
  40. cr = '0a'x
  41. call getfontsize
  42.  
  43. wid = width*48
  44. hei = theight+height*10
  45.  
  46. if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/ReverseClip Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  47.    exit
  48. end
  49.  
  50.  endframe=endfield
  51.  endfield=(StartField+(EndField-StartField)/2)
  52.  do Frame = StartField to EndField by -1
  53.         call OpenWindow(InclipName,OutClipName,frame,endframe,Frame)
  54.         'Gpfd'                                                  /* Get the next field to process */
  55.         call OpenWindow(InclipName,OutClipName,frame,endframe,Frame)
  56.         'Apfc'                                                  /* Append the field to clip */
  57.         call OpenWindow(InclipName,OutClipName,frame,endframe,Frame)
  58.         'Gpfd'                                                  /* Get the next field to process */
  59.         call OpenWindow(InclipName,OutClipName,frame,endframe,Frame)
  60.         'Apfc'                                                  /* Append the field to clip */
  61.  end
  62.         'Iclp'                                                  /* Add an flyer icon to this clip */
  63. exit
  64.  
  65. OpenWindow:
  66. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  67.   pdots="...."
  68.   dots=dots+1
  69.   if dots>4 then dots=1
  70.   call writech('Window',Clear||nv||cr)
  71.   call writech('Window','Current Source Clip ['InClipName']'cr)
  72.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  73.   call writech('Window',''cr)
  74.   call writech('Window','Current Frame:'Frame/2''cr)
  75.   call writech('Window','    End Frame:'EndFrame/2''cr)
  76.   call writech('Window',''cr)
  77.   call writech('Window','Processing'right(pdots,dots)||cr)
  78.  
  79. return
  80.  
  81. getfontsize:
  82.  
  83. if open('font','env:sys/font.prefs','R') then do
  84.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  85.    call close('font')
  86.    font = substr(font,index(font,'FONT')+4)
  87.    font = substr(font,index(font,'FONT')+4)
  88.    height = c2d(substr(font,29,2))
  89.    tfont = substr(font,index(font,'FONT')+4)
  90.    theight = c2d(substr(tfont,29,2))
  91.    font = substr(font,33)
  92.    font = left(font,index(font,d2c(0))-1-5)
  93.    if open('font','FONTS:'font'/'height,'R') then do
  94.       width = c2d(right(readch('font',116),2))
  95.       call close('font')
  96.   end
  97.   else if height=9 then width = 10
  98.                    else width = 8
  99. end
  100.   else do
  101.   theight = 8
  102.   height = 8
  103.   width = 8
  104. end
  105.  
  106. return
  107.